/*
 * @Author: zjj
 * @Date: 2019-12-31 11:10:28
 * @LastEditors  : zjj
 * @LastEditTime : 2020-01-02 16:09:53
 */
import postionDailog from "./postionDailog"
import Vue from "vue"
import store from "../store"
const postionComponent = Vue.extend(postionDailog)

const Dialog = (address = {},callBack) => {
    var dialogComponent = new postionComponent({
        el: document.createElement("div"),
        data: () => {
            return {
                address: address,
            }
        },
        methods:{
            close(){
                callBack()
                document.body.removeChild(dialogComponent.$el)
            },
            confirm(){
                store.commit("changeHandle")
                document.body.removeChild(dialogComponent.$el)
            }
        }
    })
    document.body.appendChild(dialogComponent.$el)

}
export default Dialog
